﻿using System.Threading.Tasks;
using System.Web.Http;
using Top.Api.Request;

namespace MicroAmoy.Application.Web.Controllers.Api
{
    public class TopController : ApiController
    {
        //
        // GET: /Top/
        /// <summary>
        /// 短信发送
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<string> SendMMS(AlibabaAliqinFcSmsNumSendRequest req)
        {
            return Task.Factory.StartNew(() =>
            {
                return MicroAmoy.Util.AliTop.Aliqin.SendMMS(req);
            }).ContinueWith<string>((task) =>
            {
                return task.Result;
            });
        }
        /// <summary>
        /// 淘口令生成
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<string> GenPwd(WirelessShareTpwdCreateRequest req)
        {
            return Task.Factory.StartNew(() =>
            {
                return MicroAmoy.Util.AliTop.AliPwdIsv.GenPwd(req);
            }).ContinueWith<string>((task) =>
            {
                return task.Result;
            });
        }
    }
}
